﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using FRL.DebtChased.Silverlight.Library;

namespace FRL.DebtChased.WorkflowEditor
{

	/// <summary>
	/// Declaration of WorkflowPropertiesWnd window
	/// Window for editing workflow parameters
	/// </summary>
	public partial class WorkflowPropertiesWnd : ChildWindow
	{

		/////////////////////////////////////////////////////////////
		// Attributes

		/////////////////////////////////////////////////////////////
		// Construction

		public WorkflowPropertiesWnd(
			string strName,
			string strNotes
		)
		{

			// Initialize resources
			InitializeComponent();

			// Initialize member variables
			txtName.Text = strName ?? string.Empty;
			txtNotes.Text = strNotes ?? string.Empty;

		}

		/////////////////////////////////////////////////////////////
		// Event Handlers

		private void OKButton_Click(object sender, RoutedEventArgs e)
		{

			// Check controls
			if (txtName.Text.Length == 0)
			{

				// Message for user and exit
				MessageBoxes.PopupMessage("Enter a name.");
				return;

			}

			// Close this window
			this.DialogResult = true;

		}

		private void CancelButton_Click(object sender, RoutedEventArgs e)
		{

			// Close this window
			this.DialogResult = false;

		}

	}

}

